﻿<!--<UserControl x:Class="UserSettings_Update_Silverlight.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">

    </Grid>
</UserControl>-->

<UserControl x:Class="UserSettings_Update_Silverlight.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="800" d:DesignWidth="1100" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:mak="clr-namespace:UserSettings_Update_Silverlight"
    Loaded="UserControl_Loaded">

    <UserControl.Resources>
        <mak:UnitProvider x:Key="unitProvider"></mak:UnitProvider>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot"
          Background="White" Width="1113">
        <Grid.RowDefinitions>
            <RowDefinition Height="40*"/>
            <RowDefinition Height="525*" />
        </Grid.RowDefinitions>

        <Grid x:Name="SearchGrid"
              Grid.Row="0" Margin="10,5,-5,10"
              Height="50"
              VerticalAlignment="Top">

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="225" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <TextBox
                    Grid.Column="0"
                    Height="23"
                    Margin="5"
                    Name="SearchTxt"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Left"
                    Width="200"></TextBox>

            <Button Content="Search"
                    Grid.Column="1"
                    Height="23"
                    Margin="5"
                    Name="AccountList1"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Left"
                    Width="110"
                    Click="Search_Click" />

            <Button Content="Save Changes"
                    Grid.Column="2"
                    Height="23"
                    Margin="5"
                    Name="SaveBtn"
                    VerticalAlignment="Center"
                    Width="110"
                    Click="Save_Click" />

            <Button Content="&lt; Previous"
                    Grid.Column="4"
                    Height="23"
                    Margin="5"
                    Name="Previous"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Right"
                    Width="80" Click="Previous_Click" />

            <Button Content="Next &gt;"
                    Grid.Column="5"
                    Height="23"
                    Margin="5"
                    Name="Next"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Left"
                    Width="80" Click="Next_Click" />
        </Grid>
        <sdk:DataGrid Height="650" HorizontalAlignment="Left" Margin="5,10,-5,10" Name="userSettingsGrid" VerticalAlignment="Top" Width="1100" AutoGenerateColumns="False" Grid.RowSpan="2" Grid.Row="1">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn  x:Name="FirstNameTxt" Header="First Name" Binding="{Binding Path=FullName, Mode=OneWay}" Width="200"  IsReadOnly="True"  />
                <sdk:DataGridTextColumn  x:Name="DomainNameTxt" Header="DomainName"  Binding="{Binding Path=DomainName, Mode=OneWay}" IsReadOnly="True" />

                <sdk:DataGridTemplateColumn Header="HomepageArea" IsReadOnly="True">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock  Text="{Binding HomepageArea}" Margin="5,5,5,5"  HorizontalAlignment="Left" VerticalAlignment="Center" Width="100"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                    <sdk:DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <ComboBox SelectedItem="{Binding Unit, Mode=TwoWay}" 
                                      ItemsSource="{Binding UnitList, Source={StaticResource unitProvider}}" Loaded="ComboBox_Loaded" 
                                      DisplayMemberPath="Nm" SelectedValuePath="Code"
                                      SelectionChanged="ComboBox_SelectionChanged"
                                      VerticalAlignment="Center"
                                      HorizontalAlignment="Left"
                                      Width="100"/>

                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellEditingTemplate>
                </sdk:DataGridTemplateColumn>

                <sdk:DataGridTextColumn  x:Name="HomepageSubareaTxt" Header="HomepageSubarea" IsReadOnly="True" Binding="{Binding Path=HomepageSubarea, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" />

                <sdk:DataGridTemplateColumn Header="DefaultCalendarView">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock  Text="{Binding DefaultCalendarView}" Margin="5,5,5,5"   HorizontalAlignment="Left" VerticalAlignment="Center" Width="75"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                    <sdk:DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <ComboBox SelectedItem="{Binding Unit, Mode=TwoWay}" 
                                      Loaded="ComboBox_Loaded" 
                                      SelectionChanged="ComboBoxCalendarView_SelectionChanged"
                                      VerticalAlignment="Center"
                                      HorizontalAlignment="Left"
                                      Width="100">
                                <ComboBoxItem Content="Day"></ComboBoxItem>
                                <ComboBoxItem Content="Week"></ComboBoxItem>
                                <ComboBoxItem Content="Month"></ComboBoxItem>
                            </ComboBox>

                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellEditingTemplate>
                </sdk:DataGridTemplateColumn>

                <sdk:DataGridTextColumn  x:Name="PagingLimitTxt" Header="PagingLimit" Binding="{Binding Path=PagingLimit, Mode=TwoWay, ValidatesOnExceptions=True}"  />
                <!--<sdk:DataGridTextColumn  x:Name="DefaultCalendarViewTxt" Header="DefaultCalendarView" Binding="{Binding Path=DefaultCalendarView, Mode=TwoWay}" />-->
                <sdk:DataGridCheckBoxColumn x:Name="ShowGetStartedPageChk" Header="ShowGetStartedPage" Binding="{Binding Path=GetStartedPaneContentEnabled, Mode=TwoWay}" />
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>
    </Grid>
</UserControl>

